﻿/******************************************************************************
 *  All Rights Reserved , Copyright (C) 2012 , EricHu. 
 *  作    者： EricHu
 *  创建时间： 2012-7-20 16:35:49
 ******************************************************************************/
//--------------------------------------------------------------------
// All Rights Reserved , Copyright (C) 2012 , gt TECH, Ltd.
//--------------------------------------------------------------------

using System;
using System.Data;

namespace RDIFramework.BusinessEntity
{
  using RDIFramework.Utilities;

 /// <summary>
 /// CiLogEntity
 /// 系统日志表
 ///
 /// 修改纪录
 ///
 ///		2012-03-02 版本：1.0 EricHu 创建主键。
 ///
 /// 版本：1.0
 ///
 /// <author>
 ///		<name>EricHu</name>
 ///		<date>2012-03-02</date>
 /// </author>
 /// </summary>
    [Serializable]
    public partial class CiLogEntity
    {
        private int? id = null;
        /// <summary>
        /// 主键
        /// </summary>
        public int? Id
        {
            get
            {
                return this.id;
            }
            set
            {
                this.id = value;
            }
        }

        private String processId = string.Empty;
        /// <summary>
        /// 服务
        /// </summary>
        public String ProcessId
        {
            get
            {
                return this.processId;
            }
            set
            {
                this.processId = value;
            }
        }

        private String processName = string.Empty;
        /// <summary>
        /// 服务名称
        /// </summary>
        public String ProcessName
        {
            get
            {
                return this.processName;
            }
            set
            {
                this.processName = value;
            }
        }

        private String methodEngName = string.Empty;
        /// <summary>
        /// 操作英文名称
        /// </summary>
        public String MethodEngName
        {
            get
            { 
                return this.methodEngName;
            }
            set
            {
                methodEngName = value;
            }
        }

        private String methodName = string.Empty;
        /// <summary>
        /// 操作名称
        /// </summary>
        public String MethodName
        {
            get
            {
                return this.methodName;
            }
            set
            {
                this.methodName = value;
            }
        }

        private String parameters = string.Empty;
        /// <summary>
        /// 操作参数
        /// </summary>
        public String Parameters
        {
            get
            {
                return this.parameters;
            }
            set
            {
                this.parameters = value;
            }
        }

        private String userRealName = string.Empty;
        /// <summary>
        /// 用户名
        /// </summary>
        public String UserRealName
        {
            get
            {
                return userRealName;
            }
            set
            {
                userRealName = value;
            }
        }

        private String iPAddress = string.Empty;
        /// <summary>
        /// IP地址
        /// </summary>
        public String IPAddress
        {
            get
            {
                return this.iPAddress;
            }
            set
            {
                this.iPAddress = value;
            }
        }

        private String webUrl = string.Empty;
        /// <summary>
        /// 网址
        /// </summary>
        public String WebUrl
        {
            get
            {
                return this.webUrl;
            }
            set
            {
                this.webUrl = value;
            }
        }

        private String description = string.Empty;
        /// <summary>
        /// 描述
        /// </summary>
        public String Description
        {
            get
            {
                return this.description;
            }
            set
            {
                this.description = value;
            }
        }

        private DateTime? createOn = DateTime.Now;
        /// <summary>
        /// 创建日期
        /// </summary>
        public DateTime? CreateOn
        {
            get
            {
                return this.createOn;
            }
            set
            {
                this.createOn = value;
            }
        }

        private String createUserId = string.Empty;
        /// <summary>
        /// 创建用户主键
        /// </summary>
        public String CreateUserId
        {
            get
            {
                return this.createUserId;
            }
            set
            {
                this.createUserId = value;
            }
        }

        private String createBy = string.Empty;
        /// <summary>
        /// 创建用户
        /// </summary>
        public String CreateBy
        {
            get
            {
                return this.createBy;
            }
            set
            {
                this.createBy = value;
            }
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        public CiLogEntity()
        {
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataRow">数据行</param>
        public CiLogEntity(DataRow dataRow)
        {
            this.GetFrom(dataRow);
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataReader">数据流</param>
        public CiLogEntity(IDataReader dataReader)
        {
            this.GetFrom(dataReader);
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataTable">数据表</param>
        public CiLogEntity(DataTable dataTable)
        {
            this.GetFrom(dataTable);
        }

        /// <summary>
        /// 从数据表读取
        /// </summary>
        /// <param name="dataTable">数据表</param>
        public CiLogEntity GetFrom(DataTable dataTable)
        {
            if ((dataTable == null) || (dataTable.Rows.Count == 0))
            {
                return null;
            }
            foreach (DataRow dataRow in dataTable.Rows)
            {
                this.GetFrom(dataRow);
                break;
            }
            return this;
        }

        /// <summary>
        /// 从数据行读取
        /// </summary>
        /// <param name="dataRow">数据行</param>
        public CiLogEntity GetFrom(DataRow dataRow)
        {
            this.Id = BusinessLogic.ConvertToInt(dataRow[CiLogTable.FieldId]);
            this.ProcessId = BusinessLogic.ConvertToString(dataRow[CiLogTable.FieldProcessId]);
            this.ProcessName = BusinessLogic.ConvertToString(dataRow[CiLogTable.FieldProcessName]);
            this.MethodEngName = BusinessLogic.ConvertToString(dataRow[CiLogTable.FieldMethodEngName]);
            this.MethodName = BusinessLogic.ConvertToString(dataRow[CiLogTable.FieldMethodName]);
            this.Parameters = BusinessLogic.ConvertToString(dataRow[CiLogTable.FieldParameters]);
            this.UserRealName = BusinessLogic.ConvertToString(dataRow[CiLogTable.FieldUserRealName]);
            this.IPAddress = BusinessLogic.ConvertToString(dataRow[CiLogTable.FieldIPAddress]);
            this.WebUrl = BusinessLogic.ConvertToString(dataRow[CiLogTable.FieldWebUrl]);
            this.Description = BusinessLogic.ConvertToString(dataRow[CiLogTable.FieldDescription]);
            this.CreateOn = BusinessLogic.ConvertToDateTime(dataRow[CiLogTable.FieldCreateOn]);
            this.CreateUserId = BusinessLogic.ConvertToString(dataRow[CiLogTable.FieldCreateUserId]);
            this.CreateBy = BusinessLogic.ConvertToString(dataRow[CiLogTable.FieldCreateBy]);
            return this;
        }

        /// <summary>
        /// 从数据流读取
        /// </summary>
        /// <param name="dataReader">数据流</param>
        public CiLogEntity GetFrom(IDataReader dataReader)
        {
            this.Id = BusinessLogic.ConvertToInt(dataReader[CiLogTable.FieldId]);
            this.ProcessId = BusinessLogic.ConvertToString(dataReader[CiLogTable.FieldProcessId]);
            this.ProcessName = BusinessLogic.ConvertToString(dataReader[CiLogTable.FieldProcessName]);
            this.MethodName = BusinessLogic.ConvertToString(dataReader[CiLogTable.FieldMethodName]);
            this.Parameters = BusinessLogic.ConvertToString(dataReader[CiLogTable.FieldParameters]);
            this.MethodEngName = BusinessLogic.ConvertToString(dataReader[CiLogTable.FieldMethodEngName]);
            this.UserRealName = BusinessLogic.ConvertToString(dataReader[CiLogTable.FieldUserRealName]);
            this.IPAddress = BusinessLogic.ConvertToString(dataReader[CiLogTable.FieldIPAddress]);
            this.WebUrl = BusinessLogic.ConvertToString(dataReader[CiLogTable.FieldWebUrl]);
            this.Description = BusinessLogic.ConvertToString(dataReader[CiLogTable.FieldDescription]);
            this.CreateOn = BusinessLogic.ConvertToDateTime(dataReader[CiLogTable.FieldCreateOn]);
            this.CreateUserId = BusinessLogic.ConvertToString(dataReader[CiLogTable.FieldCreateUserId]);
            this.CreateBy = BusinessLogic.ConvertToString(dataReader[CiLogTable.FieldCreateBy]);
            return this;
        }
    }
}
